package io.huaguoguo.juc;

import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @Title:
 * @Description:
 * @author: huaguoguo
 * @Date： 2021/5/18 14:02
 */
public class TryLock {

    public static void main(String[] args) {
        ReentrantLock lock = new ReentrantLock();
        new Thread(()->{
            try {
                lock.tryLock(500L, TimeUnit.MILLISECONDS);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        },"A").start();
    }
}
